home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot.new / h / cache.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-19  |  3.5 KB  |  96 lines

  1. /*    @(#)cache.h 0.1 86/01/19 SMI    */
  2.  
  3. /*
  4.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. /*
  8.  * Header file for the Sun-3 Sirius cache. 
  9.  */ 
  10. #define CX_OFF          (0x30000000)    /* context registers */
  11. #define POP_MASK        0x7cfc          /* register pop "moveml" mask */
  12. #define PUSH_MASK       0x3f3e          /* register push "moveml" mask */
  13. #define MEMORY_LOW      0x10000         /* base memory address to test */
  14.  
  15. #define TAG_MASK        0xffff0000      /* cache tags address fld mask */
  16. #define PAGE_MASK       0xffffe000      /* page mask */
  17. #define CACHEPAGE       0xc0000000      /* w/r enabled, cache pg enabled */
  18. #define SGSHIFT         17              /* binary bits per segment */
  19. #define PAGEADDRBITS    0xffffe000      /* page address bits mask */
  20.  
  21. #define    ENABLE_REG    0x40000000    /* system enable reg */
  22. #define ENA_CACHE_BIT   4               /* r/w - enable external cache */
  23. #define    EN_NORMAL    0x80        /* turns cache off */
  24. #define    EN_CACHE    0x10        /* turns cache on */
  25. #define    FC_MMU        0x03        /* to talk to mmu  */
  26.  
  27. #define    CACHE_SIZE    0x10000         /* cache size */
  28. #define CACHETOFF       0x80000000       /* cache data */
  29. #define CACHEDOFF       0x90000000       /* cache tags */
  30. #define FLUSH_OFF       0xa0000000       /* flush cache */
  31. #define NCACHEWDS       16384            /* number of cache data words */
  32. #define CACHEDINCR      4                /* cache data address increment */
  33. #define NCACHETGS       4096             /* number of cache tag words */
  34. #define    CACHETMASK    0xcfff3700       /* cache tags wr/rd mask */
  35. #define CACHETINCR      0x10             /* cache tag adr incr */
  36. #define BYTES_PER_BLOCK    16         /* bytes per cache block */    
  37. #define FLUSH_CX        1                /* flush context */
  38. #define FLUSH_PG        2                /* flush page */
  39. #define FLUSH_SG        3                /* flush segment */
  40. /* new def's for flushing setting etc */
  41. /*
  42.  *Virtual Address Cache (VAC) control space addresses
  43.  */
  44.  
  45. #define VAC_TAGS_BASE   0x80000000      /* cache tags control space base */
  46. #define VAC_DATA_BASE   0x90000000      /* cache data control space base */
  47. #define VAC_FLUSH_BASE  0xa0000000      /* flush cache control space base */
  48.  
  49. /*
  50.  * Physical Parameters of Virtual Address Cache (VAC)
  51.  */
  52.  
  53. #define VAC_BYTES_PER_BLOCK 16               /* bytes per block */
  54.  
  55. /*
  56.  * The Virtual Address Cache (VAC) has a counter which cycles bits 4 thru 8.
  57.  * The software must cycle bits beyond that.
  58.  */
  59.  
  60. #define VAC_FLUSH_LOWBIT        9
  61. #define VAC_FLUSH_HIGHBIT       15              /* 64 KB VAC */
  62. #define VAC_FLUSHALL            0
  63. #define VAC_FLUSH_ALL_COUNT     0x7f
  64. #define VAC_FLUSH_INCRMNT       512             /* bytes per flush */
  65. #define VAC_SIZE                0x10000         /* cache size */
  66.  
  67. /*
  68.  * Number of cycles to flush a context, segment and page.
  69.  * For a context flush or segment flush, we loop
  70.  * 2^(VAC_HIGH_BIT - VAC_LOW_BIT +1) times, and for a page flush,
  71.  * we loop 2^(PHSHIFT - VAC_LOW_BIT) times.  Because we use a dbra
  72.  * loop, the constants passed are one less.
  73.  */
  74. #define VAC_CTXFLUSH_COUNT      127
  75. #define VAC_SEGFLUSH_COUNT      127
  76. #define VAC_PAGEFLUSH_COUNT     15
  77.  
  78. /* Constants to do a flush */
  79.  
  80. #define VAC_CTXFLUSH            1
  81. #define VAC_PAGEFLUSH           2
  82. #define VAC_SEGFLUSH            3
  83.  
  84. /* VAC Read/Write Cache Tags. */
  85.  
  86. #define VAC_RWTAG_LOWBIT        4
  87. #define VAC_RWTAG_HIGHBIT       15              /* 64 KB VAC */
  88. #define VAC_RWTAG_INCRMNT       16
  89. #define VAC_RWTAG_COUNT         4095            /* count - 1 for dbra */
  90.  
  91. /* CPU Cache Defines */
  92.  
  93. #define CACR_CLEAR 0x8
  94. #define CACR_ENABLE 0x1
  95. #define CACR_CLEAR_ENT 0x4
  96.